<?php #if(is_array($download) && count($download)>0):?>
<div class="content" style="padding: 10px">
	<label style="width: 200px">Lọc danh sách theo ngày</label><br clear="all" />
   <?php echo input_date_range_tag('date', null, array (
  'rich' => true,
  'withtime' => true,
  'calendar_button_img' => '/sf/sf_admin/images/date.png',
)) ?>
	<input type="button" name="filter" value="Tìm kiếm" onclick="showfilter('<?php echo $userId?>',document.getElementById('date_from').value,document.getElementById('date_to').value,'filterDownload',1)" />
</div>
<?php #endif?>
<table class="user-infor" cellpadding="0">
	<tr>
		<th width="15">Ringtone_id</th>
		<th>Name</th>
		<th>Nghe</th>
		<th>Nội dung</th>
		<th>Down từ</th>
		<th>Ngày down</th>
                <th>Tải/Tặng</th>
		<th>SDT</th>
	</tr>
	<?php if(count($download)<1):?>
	<tr><td colspan="5"> Không có kết quả nào</td></tr>
	<?php else: ?>
	<?php $i=0;foreach($download as $item){?>
	<tr class="user-row<?php echo ($i%2)?>">
		<td><?php echo  $item->getRingtoneId()?></td>
		<td><?php echo $item->getRingtone()->getName()?></td>
		<td>
			<object width="250" height="24" id="audioplayer1" data="<?php echo image_path('playa/player.swf');?>" type="application/x-shockwave-flash">
			<param value="player.swf" name="movie"/>
			<param value="playerID=1&amp;soundFile=<?php echo $item->getRingtone()->getFullFilePathMp3();?>" name="FlashVars"/>
			<param value="high" name="quality"/>
			<param value="false" name="menu"/>
			<param value="transparent" name="wmode"/>
			</object>
		</td>
		<td><?php   if($item->getType() == 0) echo "Nhạc chuông";
                            if($item->getType() == 1) echo "Nhạc chờ";
                    ?>
                </td>
		<td><?php echo $item->getSourceType()?></td>
		<td><?php echo $item->getDownloadDatetime() #echo date("d-m-Y",$item->getDownloadDatetime()) ?></td>
		<td>
                        <?php
                        if ($item->getToPhone() == $item->getFromPhone()){
                            echo "Tải";
                        }else{
                            echo "Tặng";
                        }
                        ?>
                </td>
                <td><?php echo $item->getToPhone()?></td>
	</tr>
	<?php $i++;}?>
	<?php endif; ?>
</table>
<?php if ($d_totalpage > 1): ?>
<div class= "padT5 clearfix" align="right">
<?php
	#echo mypaging2::showPageAjax($d_totalpage,$task,$d_page, 'dl_list', $userId);
	echo mypaging2::showPageAjax($d_totalpage,$d_page,$task,$userId,$from,$to);
?>
</div>
<?php endif; ?>


<script type="text/javascript">
function showfilter(userid,from, to,task, page){
		$.ajax({		
			  url: '/user_detail/'+task+'/userId/'+userid+'/from/'+from+'/to/'+to+'/page/'+page,
			  success: function(data) {
			    $('#dl_list').html(data);
			  }
			});
	//}else{
	//	alert('Chưa chọn ngày tháng');
	//}
}
</script>